<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtmBox">
<head>
    <include file='./Public/common/meta.html' />
    <link rel="stylesheet" href="__PUBLIC__/js/plugins/validator-0.7.3/jquery.validator.css">
    <script type="text/javascript" src="__PUBLIC__/js/plugins/validator-0.7.3/jquery.validator.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/plugins/validator-0.7.3/local/zh_CN.js"></script>
</head>

<body>


    <div class="xsWrap">
        <!-- 顶导 -->
        <include file='./Public/common/header.html' />
        <!-- /顶导 -->
        <!-- main -->
        <div class="mainBox clearfix">
            <div class="xsNLayout">
                <!-- 编辑专辑 -->

                <div class="editAlBox">
                    <div class="xsTit">
                        <if condition="$album eq null">
                            添加专辑
                            <else/>编辑专辑/{$album.name}
                        </if>
                    </div>
                    <div class="editForm">
                    	<form action="__ROOT__/album/save_update" method="post" id="album_form" 
                    	data-validator-option="{stopOnError:false, timely:false}">
                    	<input type="hidden" name="user_id" value="<?php $user =session('__user__'); echo $user['id']; ?>" />
                    	<input type="hidden" name="id" value="{$album.id}" />
                        <div class="formCata">
                            <dl class="clearfix">
                                <dt class="formName">标题</dt>
                                <dd class="formInput">
                                    <input name="name" class="xsInput fw01" type="text" value="{$album.name}" 
                                    data-rule="required;length[4~];name;" placeholder="请至少输入4个字符的标题">
                                </dd>
                                
                            </dl>
                            <dl class="clearfix">
                                <dt class="formName">描述</dt>
                                <dd class="formInput">
                                    <textarea class="xsArea fwA01" name="discription" data-rule="required;discription;">{$album.discription}</textarea>
                                </dd>
                                <!-- <dd class="formTip">
                                    <span class="xsIcon icon_wrong"></span>请选择分类</dd>-->
                            </dl> 
                        </div>
                        <div class="formCata">
                            <dl class="clearfix">
                                <dt class="formName">分类</dt>
                                <dd class="formInput">
                                    <select class="xsSel fw01" name="category_id">
                                    	<option value="1">摄影</option>
                                    	<option value="2">美妆服饰</option>
                                    	<option value="3">美食</option>
                                    	<option value="4">运动</option>
                                    	<option value="5">科技生活</option>
                                    	<option value="6">游戏</option>
                                    	<option value="7">家居设计</option>
                                    	<option value="8">宠物</option>
                                    	<option value="9">音乐</option>
                                    	<option value="10">汽车</option>
                                        <!-- <option value="11">其它</option> -->
                                    </select>
                                </dd>
                                <!-- <dd class="formTip">
                                    <span class="xsIcon icon_wrong"></span>请选择分类</dd> -->
                            </dl>
                        </div>
                        <if condition="$album neq null">
                        <div class="formCata">
                            <dl class="clearfix">
                                <dt class="formName">删除</dt>
                                <dd class="formInput">
                                    <a class="btnE" href="javascript:delete_album({$album.id});">删除专辑</a>
                                </dd>

                            </dl>
                        </div>
                        </if>
						</form>
                    </div>
                    <p class="saveBtn">
                    <if condition="session('__user__') neq null">

                     <a class="btnD" href="javascript:album_submit();">保存设置</a>

                    <else/>
                     <a class="btnD" href="##" disabled="disabled">请先登录或注册</a>
                    </if>
                   
                    </p>
                </div>
                <!-- /编辑专辑 -->
            </div>
        </div>

        <!-- /main -->

    </div>
    <!-- 弹层 -->
    <include file="./Public/common/openWindows.html" />
    <!-- 弹层） -->

    <script type="text/javascript">
    (function($) {
    	$("select[name=category_id]").val({$cate_id});
    })(jQuery);

    function album_submit(){
    	$("#album_form").submit();
    }
   	function delete_album(album_id){
   		if(confirm("确定删除该专辑？")){

   			location.href="__ROOT__/album/delete/"+album_id+"?cate_id={$cate_id}";
   		}
   	} 
    </script>



</body>

</html>
